<% title "SourceRank Breakdown for #{@project} on #{@project.platform_name} - Libraries.io" %>

<div class="row">
  <div class="col-md-12">
    <h1><i class="fa fa-star"></i> SourceRank Breakdown for <%= link_to @project, project_path(@project.to_param) %></h1>
  </div>
</div>
<hr>

<div class="row">
    <% @breakdown = @project.source_rank_breakdown %>
    <div class="col-sm-8">
      <ul class="list-group">
        <% @breakdown.each do |key, value| %>
          <% next if skip_showing_if_zero?(key, value) %>
          <li class="list-group-item">
            <span class="badge <%= source_rank_badge_class(value) %>">
              <%= value %>
            </span>
            <%= source_rank_titles[key] || key %>
            <% if source_rank_explainations[key].present? %>
            &nbsp;<small class='text-muted'><%= fa_icon('question-circle', title: source_rank_explainations[key], class: 'tip') %></small>
            <% end %>
          </li>
        <% end %>
        <li class='list-group-item'>
          <span class='badge alert-info'>
            <%= @breakdown.values.sum > 0 ? @breakdown.values.sum : 0 %>
          </span>
          <strong>Total</strong>
        </li>
      </ul>
    </div>
  <div class="col-sm-4">
    <h3>
      <strong>
        What's SourceRank used for?
      </strong>
    </h3>
    <p>
      SourceRank is the score for a package based on a number of metrics, it's used across the site to boost high quality packages.
    </p>
    <p>
      The factors are based on attributes of a package that make it appear like a dependable package and can be handy to compare different packages.
    </p>
    <p>
      Got a question or suggestion to improve SourceRank? Open an <%= link_to 'issue', 'https://github.com/librariesio/libraries.io/issues' %> or email <%= mail_to 'support@libraries.io', 'support@libraries.io' %>
    </p>
  </div>
</div>
